package com.ch3cooh.server1.controller;

import com.ch3cooh.api.ApiResult;
import com.ch3cooh.api.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    UserService userService;

    @RequestMapping("/")
    public String canwork(){
        return "can work! ";
    }

    @RequestMapping("/login")
    public Boolean rpcLogin(){
        return userService.login();
    }

    @RequestMapping("/msg")
    public String rpcMsg(String msg){
        return userService.msg(msg);
    }

    @RequestMapping("/api/{num}")
    public ApiResult testApiResult(@PathVariable("num")Integer num){
        return userService.testResult(num);
    };

}
